﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Web_Pages_UserControls_Test : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
            string username = ((Users)Session["User"]).Username.ToString();
            if (!IsPostBack)
            {
                HienthilistPhoto(username);
            }
    }
    void HienthilistPhoto(String username)
    {

        UsersBLL userBLL = new UsersBLL();
      // string tenTaiKhoan = "user";
        Users User = userBLL.GetIUsers.GetUserByUsername(username);

        UserProfiles UserPr = userBLL.GetIUserProfiles.GetUserProfileOfUser(User);




        Albums ab = userBLL.GetIAlbums.GetAlbumById(3);


        List<Photos> listab = userBLL.GetIPhotos.GetListPhotosOfAlbum(ab);

        DataList1.DataBind();

        CollectionPager1.MaxPages = 10;

        CollectionPager1.PageSize =3; // số items hiển thị trên một trang

        CollectionPager1.DataSource = listab;

        CollectionPager1.BindToControl = DataList1;

        DataList1.DataSource = CollectionPager1.DataSourcePaged;

        


    }

}